package prolog.fluents

import prolog.terms.Int_;
import prolog.terms.Prog;
import prolog.terms.Source;
import prolog.terms.Term;
import prolog.terms.Const;

class IntegerSource1(var fuel: Long, var a:Long, var x: Long, var b:Long, p:Prog) extends prolog.terms.Source {
    //  super.p;
  
  
    
  
  def getElement():Int = {
    if(fuel<0)
       null;
    				
    var R1:Int=Int(x);
    var x=(a*x)+ b;
    var fuel:Long = fuel-1;
     R1;
  }
  
  override def stop():Unit= {
    var fuel:Long=0;
  }
  
  def toString():String = {
    "{(x->"+a+"*x+"+b+")["+fuel+"]="+x+"}";
  }
  
}
